

package vista;

import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionListener;


import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.border.TitledBorder;






/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VentanaProveedor extends javax.swing.JFrame {

	private JPanel pnlDatos;
	private JTextField txtNombre;
	private JButton btnCancelar;
	private JTextField txtDireccion;
	private JLabel lblDireccion;
	private JTextField txtCorreo;
	private JLabel lblCorreo;
	private JLabel lblTelefono;
	private JTextField txtTelefono;
	private JLabel lblNombre;
	private JTextField txtId;
	private JButton btnAceptar;
	private JLabel lblImagen;
	private JLabel lblTitulo;
	private JLabel lblId;
	private JButton btnIncluir;
	private JPanel pnlBotones;
		
	public VentanaProveedor() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			{
				pnlDatos = new JPanel();
				getContentPane().add(pnlDatos, BorderLayout.CENTER);
				pnlDatos.setLayout(null);
				pnlDatos.setPreferredSize(new java.awt.Dimension(612, 456));
				pnlDatos.setBackground(new java.awt.Color(255,255,255));
				{
					lblImagen = new JLabel();
					pnlDatos.add(lblImagen);
					lblImagen.setBounds(0, 35, 113, 375);
					lblImagen.setIcon(new ImageIcon(getClass().getClassLoader().getResource("imagen/fondo7.jpg")));
				}
				{
					pnlBotones = new JPanel();
					pnlDatos.add(pnlBotones);
					pnlBotones.setBounds(3, 300, 508, 56);
					pnlBotones.setBackground(new java.awt.Color(255,255,255));
					pnlBotones.setLayout(null);
					{
						btnIncluir = new JButton();
						pnlBotones.add(btnIncluir);
						btnIncluir.setText("Incluir");
						btnIncluir.setIcon(new ImageIcon(getClass().getClassLoader().getResource("imagen/Boton_Guardar2.jpg")));
						btnIncluir.setRolloverIcon(new ImageIcon(getClass().getClassLoader().getResource("imagen/Boton_Guardar.jpg")));
						btnIncluir.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
						btnIncluir.setActionCommand("Incluir");
						btnIncluir.setBackground(new java.awt.Color(255,255,255));
						btnIncluir.setBounds(165, 12, 81, 27);

					}
					{
						btnCancelar = new JButton();
						pnlBotones.add(btnCancelar);
						btnCancelar.setActionCommand("Cancelar");
						btnCancelar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("imagen/Boton_Cancelar2.jpg")));
						btnCancelar.setBackground(new java.awt.Color(255,255,255));
						btnCancelar.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
						btnCancelar.setRolloverIcon((new ImageIcon(getClass().getClassLoader().getResource("imagen/Boton_Cancelar.jpg"))));
						btnCancelar.setBounds(270, 9, 87, 34);
					}
					{
						btnAceptar = new JButton();
						pnlBotones.add(btnAceptar);
						btnAceptar.setActionCommand("Aceptar");
						btnAceptar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("imagen/Boton_Aceptar2.jpg")));
						btnAceptar.setBackground(new java.awt.Color(255,255,255));
						btnAceptar.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
						btnAceptar.setRolloverIcon((new ImageIcon(getClass().getClassLoader().getResource("imagen/Boton_Aceptar.jpg"))));
						btnAceptar.setBounds(163, 12, 86, 28);
					}
				}
				{
					lblId = new JLabel();
					pnlDatos.add(lblId);
					lblId.setText("ID");
					lblId.setBounds(95, 69, 11, 16);
				}
				{
					txtId = new JTextField();
					pnlDatos.add(txtId);
					txtId.setBounds(256, 68, 140, 23);
				}
				{
					lblNombre = new JLabel();
					pnlDatos.add(lblNombre);
					lblNombre.setText("Nombre");
					lblNombre.setBounds(95, 122, 104, 16);
				}
				{
					txtNombre = new JTextField();
					pnlDatos.add(txtNombre);
					txtNombre.setBounds(256, 117, 140, 23);
				}
				{
					txtTelefono = new JTextField();
					pnlDatos.add(txtTelefono);
					txtTelefono.setBounds(256, 164, 140, 23);
				}
				{
					lblTelefono = new JLabel();
					pnlDatos.add(lblTelefono);
					lblTelefono.setText("Telefono");
					lblTelefono.setBounds(95, 169, 83, 16);
				}
				{
					lblCorreo = new JLabel();
					pnlDatos.add(lblCorreo);
					lblCorreo.setText("Correo");
					lblCorreo.setBounds(95, 219, 74, 16);
				}
				{
					txtCorreo = new JTextField();
					pnlDatos.add(txtCorreo);
					txtCorreo.setBounds(256, 218, 140, 23);
				}
				{
					lblDireccion = new JLabel();
					pnlDatos.add(lblDireccion);
					lblDireccion.setText("Direccion");
					lblDireccion.setBounds(95, 266, 96, 16);
				}
				{
					txtDireccion = new JTextField();
					pnlDatos.add(txtDireccion);
					txtDireccion.setBounds(256, 265, 140, 23);
				}
				{
					lblTitulo = new JLabel();
					pnlDatos.add(lblTitulo);
					lblTitulo.setText("Registro de Proveedores");
					lblTitulo.setBounds(178, 20, 264, 15);
					lblTitulo.setFont(new java.awt.Font("Bitstream Charter",0,16));
				}
			}
			pack();
			this.setSize(535, 403);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	

	public void agregarListener(ActionListener accion)	{
		btnIncluir.addActionListener(accion);
		btnCancelar.addActionListener(accion);
		btnAceptar.addActionListener(accion);
		
	}

	public String getTxtNombre() {
		return txtNombre.getText();
	}

	

	public String getTxtDireccion() {
		return txtDireccion.getText();
	}

	

	public String getTxtCorreo() {
		return txtCorreo.getText();
	}

	

	public String getTxtTelefono() {
		return txtTelefono.getText();
	}

	

	public String getTxtId() {
		return txtId.getText();
	}

	public void setTxtId(JTextField txtId) {
		this.txtId = txtId;
	}
	
	public void setId(String id){
		this.txtId.setText(id);
	}
	
	public void setNombre(String nombre){
		this.txtNombre.setText(nombre);
	}
	
	public void setDireccion(String direccion){
		this.txtDireccion.setText(direccion);
	}
	
	public void setCorreo(String correo){
		this.txtCorreo.setText(correo);
	}
	
	public void setTelefono(String telefono){
		this.txtTelefono.setText(telefono);
	}
	
	public void limpiarTxt(){
		
		setId("");
		setNombre("");
		setDireccion("");
		setCorreo("");
		setTelefono("");
	}
	
	public void mostrarMensaje(String mensaje) {
		JOptionPane.showMessageDialog(this, mensaje);
	}
	
	public void setVisibleBtnGuardar(boolean x){
		btnIncluir.setVisible(x);
	}
	
	public void setVisibleBtnAceptar(boolean x){
		btnAceptar.setVisible(x);
	}
	
	public void setActionCommandAceptar(String nombre){
		btnAceptar.setActionCommand(nombre);
	}
	
	public void setActionCommandIncluir(String nombre){
		btnIncluir.setActionCommand(nombre);
	}
	
	public String getActionCommandAceptar(){
		return btnAceptar.getActionCommand();
	}
	
	public String getActionCommandIncluir(){
		return btnIncluir.getActionCommand();
	}
	

}